package com.yswy.domain.entity;

import com.alipay.api.response.AlipayTradePayResponse;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yswy.domain.common.BasePojo;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName(value = "pay_order")
public class PayOrder extends BasePojo<PayOrder> {
    @ApiModelProperty("order_id 订单 ID")
    private String orderId;
    @ApiModelProperty("alitradeno 支付宝订单 ID (三方订单号)")
    private String alitradeno;
    @ApiModelProperty("external_agreement_no 商户签约号")
    private String externalAgreementNo;
    @ApiModelProperty("app_id app ID")
    private String appId;
    // 订单状态  0 待支付   1 交易关闭(订单超时)  2 支付成功(待发货)   3已退款 4 支付异常
    @ApiModelProperty("order_status 订单状态")
    private Integer orderStatus;

    @ApiModelProperty("商品类型 0 金币购买  1 vip购买")
    private Integer goodType;
    // 订单类型 0 一元限时活动  1 普通产品  2 周期付款产品 3 周期付款系统收单
    @ApiModelProperty("order_type 订单类型")
    private Integer orderType;

    @ApiModelProperty("goods_id 商品 Id")
    private String goodsId;
    @ApiModelProperty("goods_id 商品 Id")
    private Long agreementOrderId;
    @ApiModelProperty("goods_id 商品 Id")
    private Long agreementOrderPayLogId;
    @ApiModelProperty("amount 实际付款金额")
    private Integer amount;
    @ApiModelProperty("user_id 用户 ID")
    private Long userId ;
    @ApiModelProperty("user_id 用户 ID")
    private String userPhone ;
    @ApiModelProperty("zfb_log_id 支付宝支付记录表ID")
    private Long zfbLogId;
    @ApiModelProperty("pay_time 付款时间")
    private Date payTime;
    @ApiModelProperty("pay_terrace 支付平台 0 支付宝   1 微信  ")
    private Integer payTerrace = 0;
    @ApiModelProperty("channel 渠道")
    private String channel;

    @TableField(exist = false)
    private PayOrderZfbLog payOrderZfbLog ;
    @TableField(exist = false)
    private PayOrderWxLog payOrderWxLog ;
    @TableField(exist = false)
    private AlipayTradePayResponse response ;
}
